from scrapy.cmdline import execute
from tasks.cleaner import DataCleanTask
from tasks.uploader import DataUploader


def start_data_upload():
    print("开始本地数据上传-----------")
    DataUploader().start_upload()
    print("本地数据上传结束。")


def start_data_clean():
    print("开始本地数据清洗-----------")
    DataCleanTask().start_clean()
    print("本地数据清洗结束。")


def start_crawl():
    print("开始crawl-----------")
    execute(['scrapy', 'crawl', 'ccgp'])
    print("crawl结束。")


if __name__ == '__main__':
    print("开始总任务调度-----------")
    # start_crawl()
    start_data_clean()
    start_data_upload()
    print("本次总任务调度结束。")
